/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.rec.be;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Diego
 */
@Entity
@Table(name = "REC_GASTO_JUDICIAL")
@NamedQueries({@NamedQuery(name = "GastoJudicial.findAll", query = "SELECT g FROM GastoJudicial g"), @NamedQuery(name = "GastoJudicial.findByIdGastoJudicial", query = "SELECT g FROM GastoJudicial g WHERE g.idGastoJudicial = :idGastoJudicial"), @NamedQuery(name = "GastoJudicial.findByMonto", query = "SELECT g FROM GastoJudicial g WHERE g.monto = :monto"), @NamedQuery(name = "GastoJudicial.findByReceptor", query = "SELECT g FROM GastoJudicial g WHERE g.receptor = :receptor"), @NamedQuery(name = "GastoJudicial.findByMotivo", query = "SELECT g FROM GastoJudicial g WHERE g.motivo = :motivo")})
public class GastoJudicial implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_GASTO_JUDICIAL", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long idGastoJudicial;
    @Column(name = "MONTO", precision = 53)
    private Double monto;
    @Column(name = "RECEPTOR", length = 50)
    private String receptor;
    @Column(name = "MOTIVO", length = 155)
    private String motivo;
    @JoinColumn(name = "FID_REC_ACCION_JUDICIAL", referencedColumnName = "ID_ACCION_JUDICIAL")
    @ManyToOne(fetch = FetchType.LAZY)
    private AccionJudicial fidRecAccionJudicial;

    public GastoJudicial() {
    }

    public GastoJudicial(Long idGastoJudicial) {
        this.idGastoJudicial = idGastoJudicial;
    }

    public Long getIdGastoJudicial() {
        return idGastoJudicial;
    }

    public void setIdGastoJudicial(Long idGastoJudicial) {
        this.idGastoJudicial = idGastoJudicial;
    }

    public Double getMonto() {
        return monto;
    }

    public void setMonto(Double monto) {
        this.monto = monto;
    }

    public String getReceptor() {
        return receptor;
    }

    public void setReceptor(String receptor) {
        this.receptor = receptor;
    }

    public String getMotivo() {
        return motivo;
    }

    public void setMotivo(String motivo) {
        this.motivo = motivo;
    }

    public AccionJudicial getFidRecAccionJudicial() {
        return fidRecAccionJudicial;
    }

    public void setFidRecAccionJudicial(AccionJudicial fidRecAccionJudicial) {
        this.fidRecAccionJudicial = fidRecAccionJudicial;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idGastoJudicial != null ? idGastoJudicial.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof GastoJudicial)) {
            return false;
        }
        GastoJudicial other = (GastoJudicial) object;
        if ((this.idGastoJudicial == null && other.idGastoJudicial != null) || (this.idGastoJudicial != null && !this.idGastoJudicial.equals(other.idGastoJudicial))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.upn.sigemfi.rec.be.GastoJudicial[idGastoJudicial=" + idGastoJudicial + "]";
    }

}
